/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.control.Label;
import javafx.scene.Group;
import javafx.geometry.HPos;
import javafx.geometry.VPos;
import javafx.scene.layout.LayoutInfo;
import javafx.scene.text.Font;

/**
 * @author Sik
 */
public class Pawn extends Group
{
    public var x : Number;
    public var y : Number;
    public var colorFill : Color;
    public var colorStroke : Color;
    public var value : String;
    public var numZone : Integer;
    public-read var height : Number = 30;
    public-read var width : Number = height;

    var border : Circle =
    Circle
    {
        pickOnBounds: true
	centerX: height/2, centerY: height/2
	radius: height/2
	fill: bind colorFill
        stroke: bind colorStroke
        strokeWidth: 3
    }

    var occupation : Label =
    Label
    {
        layoutInfo: LayoutInfo
        {
            width: width
            height: height
        }

        text: bind value
        textFill: colorStroke
        font : Font
        {
            name: "Impact"
            size: 18
        }
        hpos: HPos.CENTER
        vpos: VPos.CENTER
    }

    init
    {
        ini();
        translateX = x;
        translateY = y;
        content =
            [
                border, occupation
            ];
    }

    public function ini(): Void
    {

    }

    public function close(): Void
    {
    }
}
